<script>
import {Select} from 'element-ui'
export default {
  extends: Select,
  methods:{
    // 验证当前的选项是否在下拉项内,如果不在,那么清除
    validate(){
      if(this.multiple){
        // todo 多选的逻辑暂不实现
      }else{
        let valid = false
        this.options.some(option => {
          if(option.value === this.value){
            valid = true
          }
        })
        if(!valid){
          this.deleteSelected(new Event(''))
        }
      }
    }
  }
}
</script>

<style scoped>

</style>
